JKP - Tribute To Pollock
Bookmarklet source code:
javascript: (function() {
var largeur = window.innerWidth;
var hauteur = window.innerHeight;
var changementcouleur = 0;
var x = 0;
var y = 0;
var rint = "";
var choix = new Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "y", "z", "x", "1", "2", "3", "4", "5", "6", "7", "8", "9", "/", "*", "+", "-", ".", "(", ")", "%", "#", "&", ";", ":", "<", ">", "?", "@");
function randomlargeur() {
return Math.random() * largeur;
}
function randomhauteur() {
return Math.random() * hauteur;
}
function randomwidth() {
return (x += (Math.random() * 50) - 25) % largeur;
}
function randomfont() {
return Math.random() * 100;
}
function randomheight() {
changementcouleur += 1;
if (changementcouleur % 100 === 0) {
x = randomlargeur();
y = randomhauteur();
}
return (y += (Math.random() * 20)) % hauteur;
}
function randomcolor() {
if (changementcouleur % 100 === 0) {
rint = Math.round(0xffffff * Math.random());
}
return ('#0' + rint.toString(16)).replace(/^#0([0-9a-f]{6})$/i, '#$1');
}
function addelement() {
var elemDiv = document.createElement('div');
elemDiv.className = "bollock";
elemDiv.innerHTML = choix[Math.floor(Math.random() * choix.length)];
elemDiv.style.cssText = 'position:absolute;top:' + randomheight() + 'px;left:' + randomwidth() + 'px;font-size:' + randomfont() + 'px;color:' + randomcolor();
document.body.appendChild(elemDiv);
}
function addcolonne() {
for (i = 0; i < 100; i++) {
addelement();
}
setTimeout(addcolonne, 1000);
}
var newStyle = document.createElement('style');
newStyle.appendChild(document.createTextNode("@font-face {font-family: Averia ; src: url(http://jkp.antisocial.be/Bookmarklet/Font/fnt.php?f=WC_Rhesus_A_Bta.ttf);} .bollock { font-family: Averia ;}"));
document.head.appendChild(newStyle);
setTimeout(addcolonne, 1000);
})();
Contact:
http://jkp.antisocial.be